<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$setting.webname} - 添加单页分组</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link href="/static/admin/layui/css/layui.css" rel="stylesheet">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <style>
        #demo2 img{
            height: 110px;
        }
    </style>

</head>

<body class="gray-bg">
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-sm-4">
        <h2>分组管理</h2>
        <ol class="breadcrumb">
            <li>
                <a href="{:url('Index/admin')}">主页</a>
            </li>
            <li>
                <strong>添加分组</strong>
            </li>
        </ol>
    </div>
</div>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加分组</h5>
                </div>

                <div class="ibox-content">
                    <form class="form-horizontal">
                        <!--名称-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">分类名称：</label>
                            <div class="col-sm-4">
                                <input type="text" placeholder="请输入分类名称" id="page_name" class="form-control">
                            </div>
                            <div class='col-sm-6'></div>
                        </div>
                        <!--排序-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">排序：</label>
                            <div class="col-sm-4">
                                <input type="number" placeholder="请输入类型排序数值" id="sort" class="form-control">
                            </div>
                            <div class='col-sm-6'></div>
                        </div>
                        <!--状态-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label">状态：</label>
                            <div class="col-sm-4">
                                <select class="form-control m-b" name="status" id="status">
                                    <option value="1">显示</option>
                                    <option value="2">不显示</option>
                                </select>
                            </div>
                            <div class='col-sm-6'></div>
                        </div>
                        <!--确认-->
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-4">
                                <button type="button" class="btn btn-info btn-sm btn-block" id="save"> 保存修改</button>
                            </div>
                            <div class='col-sm-6'></div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="/static/admin/layui/layui.js"></script>
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script src="/static/admin/js/content.js?v=1.0.0"></script>
<script src="/static/admin/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>
<script>
    layui.use('upload', function() { //独立版的layer无需执行这一句
        var $ = layui.jquery, layer = layui.layer,upload = layui.upload; //独立版的layer无需执行这一句
        $("#save").click(function(){
            $.post("{:url('Pages/type_add')}",{page_name:$("#page_name").val(),sort:$("#sort").val(),status:$("#status").val()},function(data){
                layer.msg(data.msg,{time:2000},function(){
                    if(data.url){
                        window.location.href = data.url;
                    }
                });
            });
        });


        $(".check").click(function(){
            if($(this).attr('class') == "fa fa-square-o check"){
                $(this).attr('class',"fa fa-check-square-o check");
            }else{
                $(this).attr('class',"fa fa-square-o check");
            }
        });
    });
</script>

</body>
</html>
